from steps_params import args
from scene import Scene, GaussianModel
from scene.cameras import Camera
from scene.dataset_readers import sceneLoadTypeCallbacks
from utils.camera_utils import loadCam


def analyze_object(obj, parent=True):
    # 获取所有属性和方法
    all_attributes = dir(obj)
    
    # 初始化不同类型的属性列表
    normal_attributes = []
    methods = []
    special_attributes = []
    
    # 遍历所有属性
    for attr in all_attributes:
        # 获取属性值
        value = getattr(obj, attr)
        
        # 检查是否为特殊属性（以双下划线开头和结尾）
        if attr.startswith('__') and attr.endswith('__'):
            special_attributes.append(attr)
        # 检查是否为可调用对象（方法）
        elif callable(value):
            methods.append(attr)
        # 其他为普通属性
        else:
            normal_attributes.append(attr)
    if parent:
        attr_parent = analyze_object(type(obj).__bases__[0], False)
        normal_attributes = set(normal_attributes).difference(set(attr_parent))
        normal_attributes = list(normal_attributes)
    return normal_attributes

scene_info = sceneLoadTypeCallbacks["Colmap"](args.source_path, args.images, args.eval)
print(
"""
scene_info's propertys:
point_cloud
train_cameras
test_cameras
nerf_normalization
ply_path
""")
idx = 0
cam_info = scene_info.train_cameras[idx]
print(
"""
cam_info's propertys:
uid
R
T
FovY
FovX
image
image_path
image_name
width
height
""")
cam = loadCam(args, idx, cam_info, 1.0)
"""
uid
colmap_id
R
T
FoVy
FoVx
original_image
image_name
image_width
image_height
world_view_transform
full_proj_transform
training
trans
scale
zfar
znear
camera_center
data_device
projection_matrix
"""